home *** CD-ROM | disk | FTP | other *** search
-
- #ifndef _2DPANEL_H_
- #define _2DPANEL_H_
-
- //----------------------------
- //Custom Vertex
- //----------------------------
- struct CUSTOMVERTEX2DPANEL
- {
- float x,y,z,rhw;
- D3DCOLOR color; // The color
- FLOAT tu, tv; // The texture coordinates
- };
-
- #define D3DFVF_CUSTOMVERTEX2DPANEL (D3DFVF_XYZRHW|D3DFVF_DIFFUSE|D3DFVF_TEX1)
-
- //------------------------------------------------------------------
- // Name: 2DPANEL CLASS
- // Desc: *************
- //------------------------------------------------------------------
- class PANEL2D
- {
- private:
-
-
- //textura
- LPDIRECT3DTEXTURE9 *g_pTexture;
-
- //vertex do ktoreho sa ukladaju hodnoty
- CUSTOMVERTEX2DPANEL *pVertices;
-
- //
- //Funckie
- //
- void UpDateVertices();
- void ResetPoints();
- VECTOR3D GetNewPos(VECTOR3D Centre,VECTOR3D Point);
-
- public:
-
- //
- //VLASTNOSTI
- //
-
- VECTOR3D P1,P2,P3,P4; //body - vertexi
- float Rot; //rotacia - natocenie
- float Width,Height; //sirka vyska
- int NumFrames; //pocet framov
- float Frame; //Frame - snimok
- bool RelativeMode; //relativna velkost
- float Scale; //scale
- VECTOR3D Pos; //pozicia
- COLOR Color; //farba
-
- //
- //FUNKCIE
- //
-
- //konstruktor
- PANEL2D();
-
- //destruktor
- ~PANEL2D();
-
- void Create(float PanelWidth, float PanelHeight,int NumAnimFrames);
- void AddFrame(char *FileName,COLOR ColorKey);
- void ClearAllFrames();
- void Center(VECTOR3D CPos);
- void Render();
- bool MousePick(VECTOR3D Point);
-
- void SetTexture(int ToFrame,LPDIRECT3DTEXTURE9 Tex);
- };
-
-
-
- #endif //_2DPANEL_H_